package com.mce.nebula.entity;

import com.mce.nebula.common.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 操作日志实体，对应Python的OperationLog模型
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "operation_log")
public class OperationLog extends BaseEntity {
    
    @Column(name = "username", length = 64, nullable = false)
    private String username;
    
    @Column(name = "operation_type", length = 32, nullable = false)
    private String operationType;
    
    @Column(name = "enterprise_id", length = 32, nullable = false)
    private String enterpriseId;
    
    @Column(name = "team_name", length = 32, nullable = false)
    private String teamName;
    
    @Column(name = "app_id", nullable = false)
    private Integer appId;
    
    @Column(name = "service_alias", length = 32, nullable = false)
    private String serviceAlias;
    
    @Column(name = "comment", columnDefinition = "TEXT", nullable = false)
    private String comment;
    
    @Column(name = "is_openapi", nullable = false)
    private Boolean isOpenapi;
    
    @Column(name = "service_cname", length = 100, nullable = false)
    private String serviceCname;
    
    @Column(name = "app_name", length = 128, nullable = false)
    private String appName;
    
    @Column(name = "old_information", columnDefinition = "TEXT")
    private String oldInformation;
    
    @Column(name = "new_information", columnDefinition = "TEXT")
    private String newInformation;
    
    @Column(name = "information_type", length = 32, nullable = false)
    private String informationType; // 增删改三种类型
}